package com.api.weavernorth.LogWeaTable.cmd;

import com.api.weavernorth.LogWeaTable.service.Impl.LogDataServiceImpl;
import org.apache.commons.lang.StringUtils;

import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.net.URL;

/**
 * @Author: BruseeWang
 * @Date: 2021/12/08 10:23
 * @Description: 自定义方法，组装下拉框数据
 */
public class WeaTableTransMethod {
    public static String testTransMethod(String param){
        //在这里你可以实现你的任何业务逻辑
        if(StringUtils.equals(param,"1")){
            return "开始";
        }else if(StringUtils.equals(param,"2")){
            return "流转";
        }else if(StringUtils.equals(param,"3")){
            return "撤销";
        }else if(StringUtils.equals(param,"4")){
            return "结束";
        }
        return "";
    }

    public static String getType(String param){
        //在这里你可以实现你的任何业务逻辑
        if(StringUtils.equals(param,"1")){
            return "类型一";
        }else if(StringUtils.equals(param,"2")){
            return "类型二";
        }else if(StringUtils.equals(param,"3")){
            return "类型三";
        }
        return "";
    }

    public static String getHref(String param){
        //在这里你可以实现你的任何业务逻辑
        if(StringUtils.isNotBlank(param)){
            String fileName=param.substring(param.lastIndexOf("/")+1,param.length());
            String newUrl=param.substring("/usr/weaver/ecology/".length()-1,param.length());
            return "<a href='"+newUrl+"' download='"+fileName+"'>"+fileName+"</a>";
        }
        return "";
    }
}
